package com.wk.springframework.common;

import com.wk.springframework.common.exception.BeanException;
import com.wk.springframework.config.BeanDefinition;
import com.wk.springframework.config.BeanFactoryPostProcessor;
import com.wk.springframework.support.ConfigurableListableBeanFactory;

import static com.wk.springframework.common.constant.CommonConstant.BeanConstant.USER_SERVICE;

public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeanException {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition(USER_SERVICE);
        beanDefinition.getPropertyValues().addPropertyValue("company", "腾讯");
    }
}
